<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: cv::ml::TrainData Class Reference</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="navpath" id="nav-path">
  <ul>
<li class="navelem"><a class="el" href="../../d2/d75/namespacecv.html">cv</a></li><li class="navelem"><a class="el" href="../../d8/df1/namespacecv_1_1ml.html">ml</a></li><li class="navelem"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html">TrainData</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="../../d6/d91/classcv_1_1ml_1_1TrainData-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">cv::ml::TrainData Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="../../dd/ded/group__ml.html">Machine Learning</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<p>Class encapsulating training data.  
 <a href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#details">More...</a></p>
<p><code>#include &lt;opencv2/ml.hpp&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a698c4ad95ae9cace589e361f16e9dc83"><td align="right" class="memItemLeft" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a698c4ad95ae9cace589e361f16e9dc83">~TrainData</a> ()</td></tr>
<tr class="separator:a698c4ad95ae9cace589e361f16e9dc83"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7e687b7ee8325380bced49f5cd5baf15"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a7e687b7ee8325380bced49f5cd5baf15">getCatCount</a> (int vi) const =0</td></tr>
<tr class="separator:a7e687b7ee8325380bced49f5cd5baf15"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3c2c8c6bf46955d9c52f256fdfa9097c"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a3c2c8c6bf46955d9c52f256fdfa9097c">getCatMap</a> () const =0</td></tr>
<tr class="separator:a3c2c8c6bf46955d9c52f256fdfa9097c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a65ad5f0565ffe9ac26fbff8026faec36"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a65ad5f0565ffe9ac26fbff8026faec36">getCatOfs</a> () const =0</td></tr>
<tr class="separator:a65ad5f0565ffe9ac26fbff8026faec36"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0e40c6bd62aa9ad0ae6f5273d2bd824b"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a0e40c6bd62aa9ad0ae6f5273d2bd824b">getClassLabels</a> () const =0</td></tr>
<tr class="memdesc:a0e40c6bd62aa9ad0ae6f5273d2bd824b"><td class="mdescLeft"> </td><td class="mdescRight">Returns the vector of class labels.  <a href="#a0e40c6bd62aa9ad0ae6f5273d2bd824b">More...</a><br/></td></tr>
<tr class="separator:a0e40c6bd62aa9ad0ae6f5273d2bd824b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab8c65d4efcb364be41febd8e3c2dae70"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ab8c65d4efcb364be41febd8e3c2dae70">getDefaultSubstValues</a> () const =0</td></tr>
<tr class="separator:ab8c65d4efcb364be41febd8e3c2dae70"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa2d2889b6dddad5e663cb18b206ac3f1"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#aa2d2889b6dddad5e663cb18b206ac3f1">getLayout</a> () const =0</td></tr>
<tr class="separator:aa2d2889b6dddad5e663cb18b206ac3f1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a71f13029c92961dc432fcfeec376ad9a"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a71f13029c92961dc432fcfeec376ad9a">getMissing</a> () const =0</td></tr>
<tr class="separator:a71f13029c92961dc432fcfeec376ad9a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4c81aad5723a86d1f9f97e0ca2cf271b"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a4c81aad5723a86d1f9f97e0ca2cf271b">getNAllVars</a> () const =0</td></tr>
<tr class="separator:a4c81aad5723a86d1f9f97e0ca2cf271b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae14e1e1c607472f3c72a5a63679d08cb"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ae14e1e1c607472f3c72a5a63679d08cb">getNames</a> (std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; &amp;names) const =0</td></tr>
<tr class="memdesc:ae14e1e1c607472f3c72a5a63679d08cb"><td class="mdescLeft"> </td><td class="mdescRight">Returns vector of symbolic names captured in <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ab3264a32194126ff8d6821e76018cde3" title="Reads the dataset from a .csv file and returns the ready-to-use training data. ">loadFromCSV()</a>  <a href="#ae14e1e1c607472f3c72a5a63679d08cb">More...</a><br/></td></tr>
<tr class="separator:ae14e1e1c607472f3c72a5a63679d08cb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2f6bd6ae08ded472532b28e1b1266230"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a2f6bd6ae08ded472532b28e1b1266230">getNormCatResponses</a> () const =0</td></tr>
<tr class="separator:a2f6bd6ae08ded472532b28e1b1266230"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac535b6932fa5bb7d89cd50f6d7b86dc7"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ac535b6932fa5bb7d89cd50f6d7b86dc7">getNormCatValues</a> (int vi, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> sidx, int *values) const =0</td></tr>
<tr class="separator:ac535b6932fa5bb7d89cd50f6d7b86dc7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a38b6da04d4765000e890d614a01be446"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a38b6da04d4765000e890d614a01be446">getNSamples</a> () const =0</td></tr>
<tr class="separator:a38b6da04d4765000e890d614a01be446"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0f3265d83658f7effd2cb4c05fe6b8c8"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a0f3265d83658f7effd2cb4c05fe6b8c8">getNTestSamples</a> () const =0</td></tr>
<tr class="separator:a0f3265d83658f7effd2cb4c05fe6b8c8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac34c8467851769cac20d99cde52f3812"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ac34c8467851769cac20d99cde52f3812">getNTrainSamples</a> () const =0</td></tr>
<tr class="separator:ac34c8467851769cac20d99cde52f3812"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acafca98ec8fb43ddcec59af1cc906611"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#acafca98ec8fb43ddcec59af1cc906611">getNVars</a> () const =0</td></tr>
<tr class="separator:acafca98ec8fb43ddcec59af1cc906611"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a10c5bb5ac7c4b70fbc9db0d3a94684e2"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a10c5bb5ac7c4b70fbc9db0d3a94684e2">getResponses</a> () const =0</td></tr>
<tr class="separator:a10c5bb5ac7c4b70fbc9db0d3a94684e2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afc86c4d4670e535dee2459742f87ea95"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#afc86c4d4670e535dee2459742f87ea95">getResponseType</a> () const =0</td></tr>
<tr class="separator:afc86c4d4670e535dee2459742f87ea95"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acad3498d09f7d9b91fa9378b50a6c12a"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#acad3498d09f7d9b91fa9378b50a6c12a">getSample</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> varIdx, int sidx, float *buf) const =0</td></tr>
<tr class="separator:acad3498d09f7d9b91fa9378b50a6c12a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a86fc3bbc9a6d0fef62ec97b28eb452fe"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a86fc3bbc9a6d0fef62ec97b28eb452fe">getSamples</a> () const =0</td></tr>
<tr class="separator:a86fc3bbc9a6d0fef62ec97b28eb452fe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7ab7348f09a9a44bf1e30df1b979e034"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a7ab7348f09a9a44bf1e30df1b979e034">getSampleWeights</a> () const =0</td></tr>
<tr class="separator:a7ab7348f09a9a44bf1e30df1b979e034"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4fc48158587fe44f863788aefed5d245"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a4fc48158587fe44f863788aefed5d245">getTestNormCatResponses</a> () const =0</td></tr>
<tr class="separator:a4fc48158587fe44f863788aefed5d245"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae83fc71c776cd9971463c2e4dbab0427"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ae83fc71c776cd9971463c2e4dbab0427">getTestResponses</a> () const =0</td></tr>
<tr class="separator:ae83fc71c776cd9971463c2e4dbab0427"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a923fc78e64e96543bf8ebe87d179ea29"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a923fc78e64e96543bf8ebe87d179ea29">getTestSampleIdx</a> () const =0</td></tr>
<tr class="separator:a923fc78e64e96543bf8ebe87d179ea29"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae8549c2b1e3b16b8f0fc64917ffd6fd6"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ae8549c2b1e3b16b8f0fc64917ffd6fd6">getTestSamples</a> () const =0</td></tr>
<tr class="memdesc:ae8549c2b1e3b16b8f0fc64917ffd6fd6"><td class="mdescLeft"> </td><td class="mdescRight">Returns matrix of test samples.  <a href="#ae8549c2b1e3b16b8f0fc64917ffd6fd6">More...</a><br/></td></tr>
<tr class="separator:ae8549c2b1e3b16b8f0fc64917ffd6fd6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acddb9c4642e9b4f39a4bf1337ceb06f7"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#acddb9c4642e9b4f39a4bf1337ceb06f7">getTestSampleWeights</a> () const =0</td></tr>
<tr class="separator:acddb9c4642e9b4f39a4bf1337ceb06f7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0901c9bed4728e3fa29b93a0afa46371"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a0901c9bed4728e3fa29b93a0afa46371">getTrainNormCatResponses</a> () const =0</td></tr>
<tr class="memdesc:a0901c9bed4728e3fa29b93a0afa46371"><td class="mdescLeft"> </td><td class="mdescRight">Returns the vector of normalized categorical responses.  <a href="#a0901c9bed4728e3fa29b93a0afa46371">More...</a><br/></td></tr>
<tr class="separator:a0901c9bed4728e3fa29b93a0afa46371"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac248adbafbc43a1c00bfa32e2526cf4c"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ac248adbafbc43a1c00bfa32e2526cf4c">getTrainResponses</a> () const =0</td></tr>
<tr class="memdesc:ac248adbafbc43a1c00bfa32e2526cf4c"><td class="mdescLeft"> </td><td class="mdescRight">Returns the vector of responses.  <a href="#ac248adbafbc43a1c00bfa32e2526cf4c">More...</a><br/></td></tr>
<tr class="separator:ac248adbafbc43a1c00bfa32e2526cf4c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaefa64f1e3c208d4dc38127b6739eff7"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#aaefa64f1e3c208d4dc38127b6739eff7">getTrainSampleIdx</a> () const =0</td></tr>
<tr class="separator:aaefa64f1e3c208d4dc38127b6739eff7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af35073f4d4e0777159c57622df56117c"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#af35073f4d4e0777159c57622df56117c">getTrainSamples</a> (int layout=<a class="el" href="../../dd/ded/group__ml.html#gga9c57a2b823008dda53d2c7f7059a8710ab8565ac2eb79152a4e3c80b0e9c9fd4c">ROW_SAMPLE</a>, bool compressSamples=true, bool compressVars=true) const =0</td></tr>
<tr class="memdesc:af35073f4d4e0777159c57622df56117c"><td class="mdescLeft"> </td><td class="mdescRight">Returns matrix of train samples.  <a href="#af35073f4d4e0777159c57622df56117c">More...</a><br/></td></tr>
<tr class="separator:af35073f4d4e0777159c57622df56117c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad2de4f384f28259ac849e289be8d970d"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ad2de4f384f28259ac849e289be8d970d">getTrainSampleWeights</a> () const =0</td></tr>
<tr class="separator:ad2de4f384f28259ac849e289be8d970d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a38d657b15e30bc94124c31cd3c23d816"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a38d657b15e30bc94124c31cd3c23d816">getValues</a> (int vi, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> sidx, float *values) const =0</td></tr>
<tr class="separator:a38d657b15e30bc94124c31cd3c23d816"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aee63a2fc0f0679e3f8dd65dbc2c2b571"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#aee63a2fc0f0679e3f8dd65dbc2c2b571">getVarIdx</a> () const =0</td></tr>
<tr class="separator:aee63a2fc0f0679e3f8dd65dbc2c2b571"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7d08ff25ec3eed7c970a707e3000d212"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a7d08ff25ec3eed7c970a707e3000d212">getVarSymbolFlags</a> () const =0</td></tr>
<tr class="separator:a7d08ff25ec3eed7c970a707e3000d212"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a56959ac3541cd7d8d3bbcba02f8a1308"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a56959ac3541cd7d8d3bbcba02f8a1308">getVarType</a> () const =0</td></tr>
<tr class="separator:a56959ac3541cd7d8d3bbcba02f8a1308"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab444173f4d980bb3c18d856df706c920"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ab444173f4d980bb3c18d856df706c920">setTrainTestSplit</a> (int count, bool shuffle=true)=0</td></tr>
<tr class="memdesc:ab444173f4d980bb3c18d856df706c920"><td class="mdescLeft"> </td><td class="mdescRight">Splits the training data into the training and test parts.  <a href="#ab444173f4d980bb3c18d856df706c920">More...</a><br/></td></tr>
<tr class="separator:ab444173f4d980bb3c18d856df706c920"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad59c8df14e133ba492ff5cbfa21244cc"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ad59c8df14e133ba492ff5cbfa21244cc">setTrainTestSplitRatio</a> (double ratio, bool shuffle=true)=0</td></tr>
<tr class="memdesc:ad59c8df14e133ba492ff5cbfa21244cc"><td class="mdescLeft"> </td><td class="mdescRight">Splits the training data into the training and test parts.  <a href="#ad59c8df14e133ba492ff5cbfa21244cc">More...</a><br/></td></tr>
<tr class="separator:ad59c8df14e133ba492ff5cbfa21244cc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0515ddd44168aa5c42478536375c760b"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a0515ddd44168aa5c42478536375c760b">shuffleTrainTest</a> ()=0</td></tr>
<tr class="separator:a0515ddd44168aa5c42478536375c760b"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a5e0c052f9aadce1f75cddbdbbf9c4f4d"><td align="right" class="memItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html">TrainData</a> &gt; </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a5e0c052f9aadce1f75cddbdbbf9c4f4d">create</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> samples, int layout, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> responses, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> varIdx=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> sampleIdx=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> sampleWeights=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> varType=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>())</td></tr>
<tr class="memdesc:a5e0c052f9aadce1f75cddbdbbf9c4f4d"><td class="mdescLeft"> </td><td class="mdescRight">Creates training data from in-memory arrays.  <a href="#a5e0c052f9aadce1f75cddbdbbf9c4f4d">More...</a><br/></td></tr>
<tr class="separator:a5e0c052f9aadce1f75cddbdbbf9c4f4d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac3c8a080653b64495a13913903b4667c"><td align="right" class="memItemLeft" valign="top">static <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ac3c8a080653b64495a13913903b4667c">getSubMatrix</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;matrix, const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;idx, int layout)</td></tr>
<tr class="memdesc:ac3c8a080653b64495a13913903b4667c"><td class="mdescLeft"> </td><td class="mdescRight">Extract from matrix rows/cols specified by passed indexes.  <a href="#ac3c8a080653b64495a13913903b4667c">More...</a><br/></td></tr>
<tr class="separator:ac3c8a080653b64495a13913903b4667c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3d01eda6a2eb795bd7ab223b6d065e52"><td align="right" class="memItemLeft" valign="top">static <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a3d01eda6a2eb795bd7ab223b6d065e52">getSubVector</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;vec, const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;idx)</td></tr>
<tr class="memdesc:a3d01eda6a2eb795bd7ab223b6d065e52"><td class="mdescLeft"> </td><td class="mdescRight">Extract from 1D vector elements specified by passed indexes.  <a href="#a3d01eda6a2eb795bd7ab223b6d065e52">More...</a><br/></td></tr>
<tr class="separator:a3d01eda6a2eb795bd7ab223b6d065e52"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab3264a32194126ff8d6821e76018cde3"><td align="right" class="memItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html">TrainData</a> &gt; </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ab3264a32194126ff8d6821e76018cde3">loadFromCSV</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;filename, int headerLineCount, int responseStartIdx=-1, int responseEndIdx=-1, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;varTypeSpec=<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>(), char delimiter=',', char missch='?')</td></tr>
<tr class="memdesc:ab3264a32194126ff8d6821e76018cde3"><td class="mdescLeft"> </td><td class="mdescRight">Reads the dataset from a .csv file and returns the ready-to-use training data.  <a href="#ab3264a32194126ff8d6821e76018cde3">More...</a><br/></td></tr>
<tr class="separator:ab3264a32194126ff8d6821e76018cde3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a852e02da238303d33fd5923b75657584"><td align="right" class="memItemLeft" valign="top">static float </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a852e02da238303d33fd5923b75657584">missingValue</a> ()</td></tr>
<tr class="separator:a852e02da238303d33fd5923b75657584"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Class encapsulating training data. </p>
<p>Please note that the class only specifies the interface of training data, but not implementation. All the statistical model classes in <em>ml</em> module accepts Ptr&lt;<a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html" title="Class encapsulating training data. ">TrainData</a>&gt; as parameter. In other words, you can create your own class derived from <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html" title="Class encapsulating training data. ">TrainData</a> and pass smart pointer to the instance of this class into <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af96a0e04f1677a835cc25263c7db3c0c" title="Trains the statistical model. ">StatModel::train</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../dc/dd6/ml_intro.html#ml_intro_data">Training Data </a> </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a698c4ad95ae9cace589e361f16e9dc83"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a698c4ad95ae9cace589e361f16e9dc83">◆ </a></span>~TrainData()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual cv::ml::TrainData::~TrainData </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a5e0c052f9aadce1f75cddbdbbf9c4f4d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e0c052f9aadce1f75cddbdbbf9c4f4d">◆ </a></span>create()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt;<a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html">TrainData</a>&gt; cv::ml::TrainData::create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>samples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>layout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>responses</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>varIdx</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>sampleIdx</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>sampleWeights</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>varType</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml.TrainData_create(</td><td class="paramname">samples, layout, responses[, varIdx[, sampleIdx[, sampleWeights[, varType]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Creates training data from in-memory arrays. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">samples</td><td>matrix of samples. It should have CV_32F type. </td></tr>
    <tr><td class="paramname">layout</td><td>see <a class="el" href="../../dd/ded/group__ml.html#ga9c57a2b823008dda53d2c7f7059a8710" title="Sample types. ">ml::SampleTypes</a>. </td></tr>
    <tr><td class="paramname">responses</td><td>matrix of responses. If the responses are scalar, they should be stored as a single row or as a single column. The matrix should have type CV_32F or CV_32S (in the former case the responses are considered as ordered by default; in the latter case - as categorical) </td></tr>
    <tr><td class="paramname">varIdx</td><td>vector specifying which variables to use for training. It can be an integer vector (CV_32S) containing 0-based variable indices or byte vector (CV_8U) containing a mask of active variables. </td></tr>
    <tr><td class="paramname">sampleIdx</td><td>vector specifying which samples to use for training. It can be an integer vector (CV_32S) containing 0-based sample indices or byte vector (CV_8U) containing a mask of training samples. </td></tr>
    <tr><td class="paramname">sampleWeights</td><td>optional vector with weights for each sample. It should have CV_32F type. </td></tr>
    <tr><td class="paramname">varType</td><td>optional vector of type CV_8U and size <code>&lt;number_of_variables_in_samples&gt; + &lt;number_of_variables_in_responses&gt;</code>, containing types of each input and output variable. See <a class="el" href="../../dd/ded/group__ml.html#gafd82a0e568907b8680027cb246a6eb06" title="Variable types. ">ml::VariableTypes</a>. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="a7e687b7ee8325380bced49f5cd5baf15"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e687b7ee8325380bced49f5cd5baf15">◆ </a></span>getCatCount()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::ml::TrainData::getCatCount </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>vi</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getCatCount(</td><td class="paramname">vi</td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a3c2c8c6bf46955d9c52f256fdfa9097c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c2c8c6bf46955d9c52f256fdfa9097c">◆ </a></span>getCatMap()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getCatMap </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getCatMap(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a65ad5f0565ffe9ac26fbff8026faec36"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a65ad5f0565ffe9ac26fbff8026faec36">◆ </a></span>getCatOfs()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getCatOfs </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getCatOfs(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a0e40c6bd62aa9ad0ae6f5273d2bd824b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0e40c6bd62aa9ad0ae6f5273d2bd824b">◆ </a></span>getClassLabels()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getClassLabels </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getClassLabels(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns the vector of class labels. </p>
<p>The function returns vector of unique labels occurred in the responses. </p>
</div>
</div>
<a id="ab8c65d4efcb364be41febd8e3c2dae70"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab8c65d4efcb364be41febd8e3c2dae70">◆ </a></span>getDefaultSubstValues()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getDefaultSubstValues </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getDefaultSubstValues(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="aa2d2889b6dddad5e663cb18b206ac3f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa2d2889b6dddad5e663cb18b206ac3f1">◆ </a></span>getLayout()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::ml::TrainData::getLayout </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getLayout(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a71f13029c92961dc432fcfeec376ad9a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71f13029c92961dc432fcfeec376ad9a">◆ </a></span>getMissing()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getMissing </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getMissing(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a4c81aad5723a86d1f9f97e0ca2cf271b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c81aad5723a86d1f9f97e0ca2cf271b">◆ </a></span>getNAllVars()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::ml::TrainData::getNAllVars </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getNAllVars(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="ae14e1e1c607472f3c72a5a63679d08cb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae14e1e1c607472f3c72a5a63679d08cb">◆ </a></span>getNames()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::TrainData::getNames </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; &amp; </td>
          <td class="paramname"><em>names</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_TrainData.getNames(</td><td class="paramname">names</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns vector of symbolic names captured in <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ab3264a32194126ff8d6821e76018cde3" title="Reads the dataset from a .csv file and returns the ready-to-use training data. ">loadFromCSV()</a> </p>
</div>
</div>
<a id="a2f6bd6ae08ded472532b28e1b1266230"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f6bd6ae08ded472532b28e1b1266230">◆ </a></span>getNormCatResponses()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getNormCatResponses </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getNormCatResponses(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="ac535b6932fa5bb7d89cd50f6d7b86dc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac535b6932fa5bb7d89cd50f6d7b86dc7">◆ </a></span>getNormCatValues()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::TrainData::getNormCatValues </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>vi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>sidx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int * </td>
          <td class="paramname"><em>values</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a38b6da04d4765000e890d614a01be446"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a38b6da04d4765000e890d614a01be446">◆ </a></span>getNSamples()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::ml::TrainData::getNSamples </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getNSamples(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a0f3265d83658f7effd2cb4c05fe6b8c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f3265d83658f7effd2cb4c05fe6b8c8">◆ </a></span>getNTestSamples()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::ml::TrainData::getNTestSamples </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getNTestSamples(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="ac34c8467851769cac20d99cde52f3812"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac34c8467851769cac20d99cde52f3812">◆ </a></span>getNTrainSamples()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::ml::TrainData::getNTrainSamples </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getNTrainSamples(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="acafca98ec8fb43ddcec59af1cc906611"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acafca98ec8fb43ddcec59af1cc906611">◆ </a></span>getNVars()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::ml::TrainData::getNVars </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getNVars(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a10c5bb5ac7c4b70fbc9db0d3a94684e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a10c5bb5ac7c4b70fbc9db0d3a94684e2">◆ </a></span>getResponses()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getResponses </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getResponses(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="afc86c4d4670e535dee2459742f87ea95"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afc86c4d4670e535dee2459742f87ea95">◆ </a></span>getResponseType()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::ml::TrainData::getResponseType </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getResponseType(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="acad3498d09f7d9b91fa9378b50a6c12a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acad3498d09f7d9b91fa9378b50a6c12a">◆ </a></span>getSample()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::TrainData::getSample </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>varIdx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>sidx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float * </td>
          <td class="paramname"><em>buf</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_TrainData.getSample(</td><td class="paramname">varIdx, sidx, buf</td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a86fc3bbc9a6d0fef62ec97b28eb452fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a86fc3bbc9a6d0fef62ec97b28eb452fe">◆ </a></span>getSamples()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getSamples </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getSamples(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a7ab7348f09a9a44bf1e30df1b979e034"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ab7348f09a9a44bf1e30df1b979e034">◆ </a></span>getSampleWeights()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getSampleWeights </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getSampleWeights(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="ac3c8a080653b64495a13913903b4667c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac3c8a080653b64495a13913903b4667c">◆ </a></span>getSubMatrix()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getSubMatrix </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp; </td>
          <td class="paramname"><em>matrix</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp; </td>
          <td class="paramname"><em>idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>layout</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml.TrainData_getSubMatrix(</td><td class="paramname">matrix, idx, layout</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Extract from matrix rows/cols specified by passed indexes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">matrix</td><td>input matrix (supported types: CV_32S, CV_32F, CV_64F) </td></tr>
    <tr><td class="paramname">idx</td><td>1D index vector </td></tr>
    <tr><td class="paramname">layout</td><td>specifies to extract rows (cv::ml::ROW_SAMPLES) or to extract columns (cv::ml::COL_SAMPLES) </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="a3d01eda6a2eb795bd7ab223b6d065e52"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3d01eda6a2eb795bd7ab223b6d065e52">◆ </a></span>getSubVector()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getSubVector </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp; </td>
          <td class="paramname"><em>vec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp; </td>
          <td class="paramname"><em>idx</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml.TrainData_getSubVector(</td><td class="paramname">vec, idx</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Extract from 1D vector elements specified by passed indexes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">vec</td><td>input vector (supported types: CV_32S, CV_32F, CV_64F) </td></tr>
    <tr><td class="paramname">idx</td><td>1D index vector </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="a4fc48158587fe44f863788aefed5d245"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4fc48158587fe44f863788aefed5d245">◆ </a></span>getTestNormCatResponses()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getTestNormCatResponses </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getTestNormCatResponses(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="ae83fc71c776cd9971463c2e4dbab0427"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae83fc71c776cd9971463c2e4dbab0427">◆ </a></span>getTestResponses()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getTestResponses </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getTestResponses(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a923fc78e64e96543bf8ebe87d179ea29"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a923fc78e64e96543bf8ebe87d179ea29">◆ </a></span>getTestSampleIdx()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getTestSampleIdx </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getTestSampleIdx(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="ae8549c2b1e3b16b8f0fc64917ffd6fd6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae8549c2b1e3b16b8f0fc64917ffd6fd6">◆ </a></span>getTestSamples()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getTestSamples </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getTestSamples(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns matrix of test samples. </p>
</div>
</div>
<a id="acddb9c4642e9b4f39a4bf1337ceb06f7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acddb9c4642e9b4f39a4bf1337ceb06f7">◆ </a></span>getTestSampleWeights()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getTestSampleWeights </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getTestSampleWeights(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a0901c9bed4728e3fa29b93a0afa46371"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0901c9bed4728e3fa29b93a0afa46371">◆ </a></span>getTrainNormCatResponses()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getTrainNormCatResponses </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getTrainNormCatResponses(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns the vector of normalized categorical responses. </p>
<p>The function returns vector of responses. Each response is integer from <code>0</code> to <code>&lt;number of classes&gt;-1</code>. The actual label value can be retrieved then from the class label vector, see <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#a0e40c6bd62aa9ad0ae6f5273d2bd824b" title="Returns the vector of class labels. ">TrainData::getClassLabels</a>. </p>
</div>
</div>
<a id="ac248adbafbc43a1c00bfa32e2526cf4c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac248adbafbc43a1c00bfa32e2526cf4c">◆ </a></span>getTrainResponses()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getTrainResponses </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getTrainResponses(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns the vector of responses. </p>
<p>The function returns ordered or the original categorical responses. Usually it's used in regression algorithms. </p>
</div>
</div>
<a id="aaefa64f1e3c208d4dc38127b6739eff7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaefa64f1e3c208d4dc38127b6739eff7">◆ </a></span>getTrainSampleIdx()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getTrainSampleIdx </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getTrainSampleIdx(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="af35073f4d4e0777159c57622df56117c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af35073f4d4e0777159c57622df56117c">◆ </a></span>getTrainSamples()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getTrainSamples </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>layout</em> = <code><a class="el" href="../../dd/ded/group__ml.html#gga9c57a2b823008dda53d2c7f7059a8710ab8565ac2eb79152a4e3c80b0e9c9fd4c">ROW_SAMPLE</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>compressSamples</em> = <code>true</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>compressVars</em> = <code>true</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getTrainSamples(</td><td class="paramname">[, layout[, compressSamples[, compressVars]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns matrix of train samples. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">layout</td><td>The requested layout. If it's different from the initial one, the matrix is transposed. See <a class="el" href="../../dd/ded/group__ml.html#ga9c57a2b823008dda53d2c7f7059a8710" title="Sample types. ">ml::SampleTypes</a>. </td></tr>
    <tr><td class="paramname">compressSamples</td><td>if true, the function returns only the training samples (specified by sampleIdx) </td></tr>
    <tr><td class="paramname">compressVars</td><td>if true, the function returns the shorter training samples, containing only the active variables.</td></tr>
  </table>
  </dd>
</dl>
<p>In current implementation the function tries to avoid physical data copying and returns the matrix stored inside <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html" title="Class encapsulating training data. ">TrainData</a> (unless the transposition or compression is needed). </p>
</div>
</div>
<a id="ad2de4f384f28259ac849e289be8d970d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad2de4f384f28259ac849e289be8d970d">◆ </a></span>getTrainSampleWeights()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getTrainSampleWeights </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getTrainSampleWeights(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a38d657b15e30bc94124c31cd3c23d816"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a38d657b15e30bc94124c31cd3c23d816">◆ </a></span>getValues()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::TrainData::getValues </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>vi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>sidx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float * </td>
          <td class="paramname"><em>values</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_TrainData.getValues(</td><td class="paramname">vi, sidx, values</td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="aee63a2fc0f0679e3f8dd65dbc2c2b571"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aee63a2fc0f0679e3f8dd65dbc2c2b571">◆ </a></span>getVarIdx()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getVarIdx </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getVarIdx(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a7d08ff25ec3eed7c970a707e3000d212"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d08ff25ec3eed7c970a707e3000d212">◆ </a></span>getVarSymbolFlags()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getVarSymbolFlags </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getVarSymbolFlags(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="a56959ac3541cd7d8d3bbcba02f8a1308"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a56959ac3541cd7d8d3bbcba02f8a1308">◆ </a></span>getVarType()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::TrainData::getVarType </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_TrainData.getVarType(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<a id="ab3264a32194126ff8d6821e76018cde3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3264a32194126ff8d6821e76018cde3">◆ </a></span>loadFromCSV()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt;<a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html">TrainData</a>&gt; cv::ml::TrainData::loadFromCSV </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp; </td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>headerLineCount</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>responseStartIdx</em> = <code>-1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>responseEndIdx</em> = <code>-1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp; </td>
          <td class="paramname"><em>varTypeSpec</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char </td>
          <td class="paramname"><em>delimiter</em> = <code>','</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char </td>
          <td class="paramname"><em>missch</em> = <code>'?'</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Reads the dataset from a .csv file and returns the ready-to-use training data. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filename</td><td>The input file name </td></tr>
    <tr><td class="paramname">headerLineCount</td><td>The number of lines in the beginning to skip; besides the header, the function also skips empty lines and lines staring with <code>#</code> </td></tr>
    <tr><td class="paramname">responseStartIdx</td><td>Index of the first output variable. If -1, the function considers the last variable as the response </td></tr>
    <tr><td class="paramname">responseEndIdx</td><td>Index of the last output variable + 1. If -1, then there is single response variable at responseStartIdx. </td></tr>
    <tr><td class="paramname">varTypeSpec</td><td>The optional text string that specifies the variables' types. It has the format <code>ord[n1-n2,n3,n4-n5,...]cat[n6,n7-n8,...]</code>. That is, variables from <code>n1 to n2</code> (inclusive range), <code>n3</code>, <code>n4 to n5</code> ... are considered ordered and <code>n6</code>, <code>n7 to n8</code> ... are considered as categorical. The range <code>[n1..n2] + [n3] + [n4..n5] + ... + [n6] + [n7..n8]</code> should cover all the variables. If varTypeSpec is not specified, then algorithm uses the following rules:<ul>
<li>all input variables are considered ordered by default. If some column contains has non- numerical values, e.g. 'apple', 'pear', 'apple', 'apple', 'mango', the corresponding variable is considered categorical.</li>
<li>if there are several output variables, they are all considered as ordered. <a class="el" href="../../d1/d0d/namespacecv_1_1Error.html">Error</a> is reported when non-numerical values are used.</li>
<li>if there is a single output variable, then if its values are non-numerical or are all integers, then it's considered categorical. Otherwise, it's considered ordered. </li>
</ul>
</td></tr>
    <tr><td class="paramname">delimiter</td><td>The character used to separate values in each line. </td></tr>
    <tr><td class="paramname">missch</td><td>The character used to specify missing measurements. It should not be a digit. Although it's a non-numerical value, it surely does not affect the decision of whether the variable ordered or categorical. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>If the dataset only contains input variables and no responses, use responseStartIdx = -2 and responseEndIdx = 0. The output variables vector will just contain zeros. </dd></dl>
</div>
</div>
<a id="a852e02da238303d33fd5923b75657584"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a852e02da238303d33fd5923b75657584">◆ </a></span>missingValue()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static float cv::ml::TrainData::missingValue </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ab444173f4d980bb3c18d856df706c920"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab444173f4d980bb3c18d856df706c920">◆ </a></span>setTrainTestSplit()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::TrainData::setTrainTestSplit </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>shuffle</em> = <code>true</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_TrainData.setTrainTestSplit(</td><td class="paramname">count[, shuffle]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Splits the training data into the training and test parts. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ad59c8df14e133ba492ff5cbfa21244cc" title="Splits the training data into the training and test parts. ">TrainData::setTrainTestSplitRatio</a> </dd></dl>
</div>
</div>
<a id="ad59c8df14e133ba492ff5cbfa21244cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad59c8df14e133ba492ff5cbfa21244cc">◆ </a></span>setTrainTestSplitRatio()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::TrainData::setTrainTestSplitRatio </td>
          <td>(</td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>ratio</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>shuffle</em> = <code>true</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_TrainData.setTrainTestSplitRatio(</td><td class="paramname">ratio[, shuffle]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Splits the training data into the training and test parts. </p>
<p>The function selects a subset of specified relative size and then returns it as the training set. If the function is not called, all the data is used for training. Please, note that for each of TrainData::getTrain* there is corresponding TrainData::getTest*, so that the test subset can be retrieved and processed as well. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html#ab444173f4d980bb3c18d856df706c920" title="Splits the training data into the training and test parts. ">TrainData::setTrainTestSplit</a> </dd></dl>
</div>
</div>
<a id="a0515ddd44168aa5c42478536375c760b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0515ddd44168aa5c42478536375c760b">◆ </a></span>shuffleTrainTest()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::TrainData::shuffleTrainTest </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_TrainData.shuffleTrainTest(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>opencv2/<a class="el" href="../../d3/d29/ml_8hpp.html">ml.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:48 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
